package com.TanNgee.controller;

import com.TanNgee.framework.context.ApplicationContext;
import com.TanNgee.framework.context.support.ClassPathXmlApplicationContext;
import com.TanNgee.service.UserService;

/**
 * @author 陈毅
 * @create 2022/4/24 9:54
 */
public class UserController {
    public static void main(String[] args) throws Exception {
        // 1,创建Spring的容器对象
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");

        // 2,从容器对象中获取userService对象
        UserService userService = applicationContext.getBean("userService", UserService.class);

        // 3,调用userService方法进行业务逻辑处理
        userService.add();


    }
}
